package com.dimples.dd.system.controller;

import com.dimples.dd.web.core.annotation.PreventDuplicateResubmit;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2024/6/4
 */
@Slf4j
@RestController
public class TestController {
    @GetMapping("info")
    public String test() {
        return "dd-server-system";
    }

    @GetMapping("user")
    public Principal currentUser(Principal principal) {
        return principal;
    }

    @GetMapping("hello")
    @PreventDuplicateResubmit
    public String hello(String name) {
        log.info("dd-test调用参数[name = {}]", name);
        return "hello: " + name;
    }
}
